
/*
 * Copyright (C) 2008-2009 Archie L. Cobbs. All rights reserved.
 *
 * $Id: FieldSwitchAdapter.java 377 2010-03-11 20:50:18Z archie.cobbs $
 */

package org.dellroad.sidekar;

/**
 * Adapter class for {@link FieldSwitch} implementations.
 */
public class FieldSwitchAdapter implements FieldSwitch {

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseImplicitField}.
     */
    public void caseAttachedField(AttachedField field) {
        caseImplicitField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseImplicitField}.
     */
    public void caseEntityField(EntityField field) {
        caseImplicitField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseImplicitField}.
     */
    public void caseIdField(IdField field) {
        caseImplicitField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseSimpleField}.
     */
    public <E> void caseReferenceField(ReferenceField<E> field) {
        caseSimpleField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseCollectionField}.
     */
    public <E> void caseSetField(SetField<E> field) {
        caseCollectionField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseComplexField}.
     */
    public <K, V> void caseMapField(MapField<K, V> field) {
        caseComplexField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseCollectionField}.
     */
    public <E> void caseListField(ListField<E> field) {
        caseCollectionField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseStringField(StringField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseSimpleField}.
     */
    public <E> void caseArrayField(ArrayField<E> field) {
        caseSimpleField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseBooleanField(BooleanField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseByteField(ByteField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseCharacterField(CharacterField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseShortField(ShortField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseIntegerField(IntegerField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseFloatField(FloatField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseDoubleField(DoubleField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseLongField(LongField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseDateField(DateField field) {
        caseAtomicField(field);
    }

    /**
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    public void caseBigIntegerField(BigIntegerField field) {
        caseAtomicField(field);
    }

    /**
     * Internal roll-up method.
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseAtomicField}.
     */
    protected <E> void caseImplicitField(ImplicitField<E> field) {
        caseAtomicField(field);
    }

    /**
     * Internal roll-up method.
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseSimpleField}.
     */
    protected <E> void caseAtomicField(AtomicField<E> field) {
        caseSimpleField(field);
    }

    /**
     * Internal roll-up method.
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseDefault}.
     */
    protected <E> void caseSimpleField(SimpleField<E> field) {
        caseDefault(field);
    }

    /**
     * Internal roll-up method.
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseComplexField}.
     */
    protected <E> void caseCollectionField(CollectionField<E> field) {
        caseComplexField(field);
    }

    /**
     * Internal roll-up method.
     * The implementation in {@link FieldSwitchAdapter} delegates to {@link #caseDefault}.
     */
    protected <T> void caseComplexField(ComplexField<T> field) {
        caseDefault(field);
    }

    /**
     * Internal roll-up method.
     * The implementation in {@link FieldSwitchAdapter} does nothing.
     */
    protected <T> void caseDefault(Field<T> field) {
    }
}

